package org.example.registry;

import org.example.spi.SpiLoader;

/**
 * @Title: RegisterFactory
 * @Author: kunliangzhao
 * @Package org.example.registry
 * @Date: 2025/6/12 14:00
 * @Description: 注册中心工厂，获取注册中心实例
 */
public class RegistryFactory {

    static {
        SpiLoader.load(Registry.class);
    }

    /**
     * 默认注册中心
     */
    private static final Registry DEFAULT_REGISTRY = new EtcdRegistry();


    /**
     * 获取注册中心实例
     */
    public static Registry getInstance(String key){
        return SpiLoader.getInstance(Registry.class, key);
    }
}
